package com.example.broadcastreciver2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.IntentFilter;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //动态注册
        IntentFilter intentFilter = new IntentFilter("com.example.broadcastsender.ACION.NORMAL_BC");
        intentFilter.setPriority(400);
        registerReceiver(new MyReceiver(), intentFilter);
    }
}